@Echo Off

set msbuild=

for /F "tokens=1,2*" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBUILD\ToolsVersions\4.0" /v "MSBuildToolsPath"') do (
    if "%%i" == "MSBuildToolsPath" (
        set "msbuild=%%k"
    )
)

if "%msbuild%"=="" exit /B 1

@"%msbuild%MSBuild.exe" /t:rebuild /m "Mercury.ParticleEngine.sln"